home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_078 / mandelvroom / presets.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  17KB  |  608 lines

  1. /***************************************************************************
  2.  *
  3.  *                 MandelVroom Preset Pictures code
  4.  *
  5.  *                         Kevin L. Clague
  6.  *
  7.  *                        Copyright (C) 1987
  8.  *
  9.  **************************************************************************/
  10.  
  11. #include "mand.h"
  12.  
  13. #define NUMPRESETS 10
  14.  
  15. extern struct ViewPort *vp;
  16.  
  17. extern struct Screen *screen;
  18. extern struct NewScreen NewScreen;
  19.  
  20. extern struct Window *MandWind;
  21.  
  22. extern float StartX,StartY,EndX,EndY;
  23. extern SHORT CountX,CountY,MaxCount;
  24.  
  25. extern SHORT NumContours, *ContourBase;
  26. extern UBYTE *ColorBase;
  27.  
  28. extern UBYTE MandType;
  29. extern ULONG BorderType;
  30.  
  31. extern SHORT *CountBase;
  32.  
  33. struct Preset {
  34.   char   *Name;
  35.   float   StartX, StartY, EndX, EndY;
  36.   SHORT   CountX, CountY;
  37.   SHORT   MaxCount;
  38.   UBYTE   MandType;
  39.   USHORT  ViewModes;
  40.   USHORT  Depth;
  41.   ULONG   BorderType;
  42.   SHORT  *ColorMap;
  43.   SHORT   NumContours;
  44.   USHORT *Contours;
  45.   UBYTE  *Pens;
  46. };
  47.  
  48. extern struct Preset Preset[];
  49.  
  50. /*
  51.  * Generate a preset picture
  52.  */
  53. SetPreset(Number)
  54.   int Number;
  55. {
  56.   if (InitPreset(Number) == 0) {
  57.  
  58.     CloseDisp();
  59.     OpenDisp();
  60.  
  61.     if (MandWind->Width  != CountX + LEFTMARG + RIGHTMARG ||
  62.         MandWind->Height != CountY + TOPMARG  + BOTMARG)
  63.       SizeWindow(MandWind, CountX + LEFTMARG + RIGHTMARG - MandWind->Width,
  64.                            CountY + TOPMARG  + BOTMARG   - MandWind->Height);
  65.     Delay(1);
  66.     GenerateIt();
  67.   }
  68. }
  69.  
  70. /*
  71.  * Set up system from preset list
  72.  */
  73. InitPreset(Number)
  74.   int Number;
  75. {
  76.   struct  Preset *CurPreset;
  77.   SHORT  *CurColors;
  78.   USHORT *CurContours;
  79.   UBYTE  *CurPens;
  80.  
  81.   SHORT   i;
  82.  
  83.   if (Number < NUMPRESETS) {
  84.  
  85.     if (CountBase) {
  86.       FreeMem(CountBase,CountX*CountY*sizeof(SHORT));
  87.       CountBase = (SHORT *) NULL;
  88.     }
  89.  
  90.     CurPreset = &Preset[Number];
  91.     StartX = CurPreset->StartX;
  92.     StartY = CurPreset->StartY;
  93.     EndX   = CurPreset->EndX;
  94.     EndY   = CurPreset->EndY;
  95.  
  96.     CountX = CurPreset->CountX;
  97.     CountY = CurPreset->CountY;
  98.  
  99.     MaxCount = CurPreset->MaxCount;
  100.  
  101.     MandType = CurPreset->MandType;
  102.  
  103.     NewScreen.ViewModes = CurPreset->ViewModes;
  104.     NewScreen.Depth = CurPreset->Depth;
  105.  
  106.     BorderType = CurPreset->BorderType;
  107.  
  108.     CurColors = CurPreset->ColorMap;
  109.  
  110.     LoadRGB4(vp, CurColors, 32);
  111.  
  112.     CurContours = CurPreset->Contours;
  113.  
  114.     for (i = 0; i < NumContours; i++)
  115.       *(ContourBase + i) = *CurContours++;
  116.  
  117.     CurPens = CurPreset->Pens;
  118.  
  119.     for (i = 0; i < NumContours; i++)
  120.       *(ColorBase + i) = *CurPens++;
  121.  
  122.     return(0);
  123.   } else {
  124.     DispErrMsg("Invalid Preset",0);
  125.     return(1);
  126.   }
  127. }
  128.  
  129. /**************************************************************************
  130.  *
  131.  *  Preset arrays for generating pictures
  132.  *
  133.  *************************************************************************/
  134.  
  135. SHORT big_brotPalette[] =
  136. {
  137.   0x0000,  0x0fff,  0x0ddf,  0x0bbf,  0x099f,  0x077c,  0x055a,  0x0337,
  138.   0x0114,  0x0337,  0x055a,  0x077c,  0x099f,  0x0bbf,  0x0ccf,  0x0eef,
  139.   0x0000,  0x0fff,  0x0fff,  0x0eef,  0x0eef,  0x0ddf,  0x0ddf,  0x0ccf,
  140.   0x0ccf,  0x099f,  0x088d,  0x066b,  0x055a,  0x0338,  0x0226,  0x0fff
  141. };
  142. USHORT big_brotHeights[] =
  143. {
  144.   1023,  283,  257,  231,  205,  180,  154,  128,
  145.   103,  100,  95,  90,  85,  80,  75,  69,
  146.   35,  31,  28,  25,  21,  18,  15,  11,
  147.   7,  6,  5,  4,  3,  2,  1,  0
  148. };
  149. UBYTE big_brotPens[] =
  150. {
  151.   0,  1,  2,  3,  4,  5,  6,  7,
  152.   8,  9,  10,  11,  12,  13,  14,  15,
  153.   17,  18,  19,  20,  21,  22,  23,  24,
  154.   25,  26,  27,  28,  29,  30,  30,  0
  155. };
  156.  
  157. SHORT Hey_BabyPalette[] =
  158. {
  159.   0x0000,  0x0fff,  0x0ede,  0x0dbc,  0x0c9b,  0x0b6a,  0x0a49,  0x0927,
  160.   0x0806,  0x0716,  0x0727,  0x0637,  0x0658,  0x0568,  0x0579,  0x0489,
  161.   0x0000,  0x0fff,  0x0dee,  0x0bcd,  0x09bc,  0x06aa,  0x0499,  0x0278,
  162.   0x0067,  0x059a,  0x0acc,  0x0fff,  0x0bdd,  0x08bb,  0x0489,  0x0067
  163. };
  164.  
  165. USHORT Hey_BabyHeights[] =
  166. {
  167.   1023,  247,  220,  193,  167,  160,  154,  147,
  168.   141,  134,  128,  122,  115,  110,  106,  102,
  169.   98,  93,  89,  85,  81,  77,  74,  73,
  170.   72,  71,  70,  69,  68,  67,  66,  65
  171. };
  172.  
  173. UBYTE Hey_BabyPens[] =
  174. {
  175.   0,  1,  2,  3,  4,  5,  6,  7,
  176.   8,  9,  10,  11,  12,  13,  14,  15,
  177.   30,  29,  28,  27,  26,  25,  24,  23,
  178.   22,  21,  20,  19,  18,  17,  20,  23
  179. };
  180.  
  181. SHORT dragon_familyPalette[] =
  182. {
  183.   0x0000,  0x0a00,  0x0f20,  0x0f40,  0x0f60,  0x0f80,  0x0f90,  0x0fb0,
  184.   0x0fd0,  0x0ff0,  0x0dd1,  0x0bb2,  0x0993,  0x0884,  0x0665,  0x0446,
  185.   0x0227,  0x0008,  0x0207,  0x0406,  0x0605,  0x0804,  0x0903,  0x0b02,
  186.   0x0d01,  0x0f00,  0x0f20,  0x0f40,  0x0f50,  0x0f70,  0x0f90,  0x0fb0
  187. };
  188.  
  189. USHORT dragon_familyHeights[] =
  190. {
  191.   1023,  142,  132,  123,  113,  104,  99,  94,
  192.   89,  84,  79,  74,  71,  68,  66,  63,
  193.   60,  58,  55,  52,  50,  48,  47,  45,
  194.   44,  42,  41,  39,  38,  36,  35,  34
  195. };
  196.  
  197. UBYTE dragon_familyPens[] =
  198. {
  199.   0,  1,  2,  3,  4,  5,  6,  7,
  200.   8,  9,  10,  11,  12,  13,  14,  15,
  201.   16,  17,  18,  19,  20,  21,  22,  23,
  202.   24,  25,  26,  27,  28,  29,  30,  31
  203. };
  204.  
  205. SHORT sea_horsePalette[] =
  206. {
  207.   0x0000,  0x0fff,  0x0ddd,  0x0bbb,  0x0999,  0x0666,  0x0444,  0x0222,
  208.   0x0000,  0x0002,  0x0003,  0x0005,  0x0006,  0x0007,  0x0009,  0x000a,
  209.   0x002a,  0x003a,  0x0059,  0x0069,  0x0020,  0x0030,  0x0040,  0x0040,
  210.   0x0050,  0x0060,  0x0050,  0x0040,  0x0030,  0x0020,  0x0010,  0x0fff
  211. };
  212.  
  213. USHORT sea_horseHeights[] =
  214. {
  215.   1023,  635,  542,  449,  356,  263,  171,  145,
  216.   142,  140,  138,  135,  132,  128,  125,  122,
  217.   119,  115,  112,  109,  106,  103,  98,  94,
  218.   89,  85,  80,  76,  71,  67,  62,  58
  219. };
  220.  
  221. UBYTE sea_horsePens[] =
  222. {
  223.   0,  7,  6,  5,  4,  3,  3,  1,
  224.   4,  6,  10,  11,  12,  13,  14,  15,
  225.   16,  17,  18,  19,  20,  8,  22,  23,
  226.   24,  25,  26,  27,  28,  29,  30,  0
  227. };
  228.  
  229. SHORT spinePalette[] =
  230. {
  231.   0x0000,  0x0600,  0x0800,  0x0b00,  0x0d00,  0x0f00,  0x0f40,  0x0f80,
  232.   0x0fb0,  0x0ff0,  0x0bb0,  0x0660,  0x0220,  0x0335,  0x022a,  0x000f,
  233.   0x0c50,  0x0b40,  0x0940,  0x0830,  0x0630,  0x0520,  0x0310,  0x0210,
  234.   0x0000,  0x00c0,  0x0aaa,  0x0bbb,  0x0ccc,  0x0ddd,  0x0eee,  0x0fff
  235. };
  236.  
  237. USHORT spineHeights[] =
  238. {
  239.   1023,  318,  295,  272,  249,  226,  203,  180,
  240.   157,  135,  127,  120,  113,  106,  99,  92,
  241.   85,  68,  65,  62,  59,  56,  53,  0,
  242.   44,  43,  42,  41,  40,  39,  0,  0
  243. };
  244.  
  245. UBYTE spinePens[] =
  246. {
  247.   15,  5,  4,  3,  2,  1,  2,  3,
  248.   4,  5,  6,  7,  8,  9,  10,  11,
  249.   12,  0,  13,  14,  15,  14,  13,  0,
  250.   14,  13,  14,  15,  14,  13,  0,  31
  251. };
  252.  
  253. SHORT vertibraePalette[] =
  254. {
  255.   0x0000,  0x0f00,  0x0e01,  0x0d01,  0x0c02,  0x0a02,  0x0903,  0x0803,
  256.   0x0923,  0x0a42,  0x0b62,  0x0c82,  0x0c91,  0x0db1,  0x0ed0,  0x0ff0,
  257.   0x0de0,  0x0cd0,  0x0ac0,  0x09b0,  0x07a0,  0x0590,  0x0480,  0x0270,
  258.   0x0272,  0x0283,  0x0185,  0x0196,  0x0198,  0x0199,  0x00ab,  0x00ac
  259. };
  260.  
  261. USHORT vertibraeHeights[] =
  262. {
  263.   1023,  389,  355,  321,  287,  253,  219,  185,
  264.   151,  134,  127,  120,  113,  106,  99,  92,
  265.   85,  68,  66,  65,  63,  62,  61,  59,
  266.   58,  57,  55,  54,  53,  0,  0,  0
  267. };
  268.  
  269. UBYTE vertibraePens[] =
  270. {
  271.   15,  1,  2,  3,  4,  5,  6,  7,
  272.   8,  9,  10,  11,  12,  13,  14,  15,
  273.   16,  17,  18,  19,  20,  21,  22,  23,
  274.   24,  25,  26,  27,  28,  29,  30,  31
  275. };
  276.  
  277. SHORT beauty2Palette[] =
  278. {
  279.   0x0000,  0x0d22,  0x0c22,  0x0b22,  0x0a22,  0x0822,  0x0932,  0x0b32,
  280.   0x0c42,  0x0d52,  0x0d71,  0x0e91,  0x0ea1,  0x0ec1,  0x0fd0,  0x0ff0,
  281.   0x0bd0,  0x08b0,  0x0490,  0x0070,  0x0062,  0x0053,  0x0045,  0x0047,
  282.   0x0038,  0x002a,  0x001b,  0x000d,  0x000a,  0x0007,  0x0004,  0x0f0f
  283. };
  284.  
  285. USHORT beauty2Heights[] =
  286. {
  287.   1023,  465,  427,  389,  351,  313,  276,  259,
  288.   244,  229,  213,  198,  183,  167,  163,  158,
  289.   154,  151,  148,  145,  142,  138,  134,  130,
  290.   126,  122,  118,  114,  109,  104,  99,  100
  291. };
  292.  
  293. UBYTE beauty2Pens[] =
  294. {
  295.   31,  1,  2,  3,  4,  5,  6,  7,
  296.   8,  9,  10,  11,  12,  13,  14,  15,
  297.   16,  17,  18,  19,  20,  21,  22,  23,
  298.   24,  25,  26,  27,  28,  29,  30,  0
  299. };
  300.  
  301. SHORT linkPalette[] =
  302. {
  303.   0x0000,  0x0ff0,  0x0f00,  0x0e00,  0x0c00,  0x0b00,  0x0900,  0x0800,
  304.   0x0600,  0x0fff,  0x0eee,  0x0ccc,  0x0bbb,  0x0999,  0x0888,  0x0777,
  305.   0x0555,  0x0ff0,  0x0f00,  0x0900,  0x0111,  0x0222,  0x0222,  0x0444,
  306.   0x0555,  0x0777,  0x0999,  0x0aaa,  0x0ccc,  0x0ddd,  0x0fff,  0x000f
  307. };
  308.  
  309. USHORT linkHeights[] =
  310. {
  311.   1023,  706,  675,  621,  568,  515,  461,  408,
  312.   355,  301,  248,  195,  163,  160,  158,  156,
  313.   154,  152,  150,  148,  146,  144,  142,  140,
  314.   138,  136,  134,  132,  130,  128,  126,  124
  315. };
  316.  
  317. UBYTE linkPens[] =
  318. {
  319.   0,  1,  2,  3,  4,  5,  6,  7,
  320.   8,  6,  4,  3,  0,  22,  23,  24,
  321.   25,  26,  26,  27,  28,  29,  30,  29,
  322.   28,  28,  27,  25,  25,  24,  23,  22
  323. };
  324.  
  325. SHORT pretty_babyPalette[] =
  326. {
  327.   0x0000,  0x0044,  0x0255,  0x0477,  0x0688,  0x0abc,  0x0eef,  0x0ccf,
  328.   0x0bbf,  0x0aaf,  0x088e,  0x077e,  0x066e,  0x044d,  0x033d,  0x011c,
  329.   0x000c,  0x0310,  0x0420,  0x0521,  0x0531,  0x0632,  0x0742,  0x0842,
  330.   0x0953,  0x0953,  0x0a64,  0x0b64,  0x0953,  0x0732,  0x0421,  0x0200
  331. };
  332.  
  333. USHORT pretty_babyHeights[] =
  334. {
  335.   1023,  618,  541,  465,  389,  313,  308,  304,
  336.   300,  296,  292,  288,  284,  280,  276,  272,
  337.   267,  203,  200,  197,  195,  192,  190,  187,
  338.   185,  182,  179,  177,  174,  172,  169,  167
  339. };
  340.  
  341. UBYTE pretty_babyPens[] =
  342. {
  343.   0,  1,  2,  3,  4,  5,  6,  7,
  344.   8,  9,  10,  11,  12,  13,  14,  15,
  345.   16,  17,  18,  19,  20,  21,  22,  23,
  346.   24,  25,  26,  27,  28,  29,  30,  31
  347. };
  348.  
  349. SHORT horse_chainPalette[] =
  350. {
  351.   0x0000,  0x0a90,  0x0f00,  0x0d00,  0x0c00,  0x0a00,  0x0800,  0x0600,
  352.   0x0400,  0x0fff,  0x0eee,  0x0ccc,  0x0bbb,  0x0999,  0x0888,  0x0777,
  353.   0x0555,  0x0ff0,  0x0f00,  0x0d20,  0x0a30,  0x0620,  0x0222,  0x0444,
  354.   0x0555,  0x0777,  0x0999,  0x0aaa,  0x0ccc,  0x0ddd,  0x0fff,  0x000f
  355. };
  356.  
  357. USHORT horse_chainHeights[] =
  358. {
  359.   1023,  706,  441,  371,  295,  265,  247,  226,
  360.   205,  195,  185,  174,  136,  133,  130,  127,
  361.   124,  121,  118,  116,  113,  110,  107,  104,
  362.   101,  99,  96,  93,  90,  87,  84,  82
  363. };
  364.  
  365. UBYTE horse_chainPens[] =
  366. {
  367.   31,  1,  8,  7,  6,  5,  4,  3,
  368.   2,  19,  20,  21,  0,  22,  23,  24,
  369.   25,  26,  26,  27,  28,  29,  30,  29,
  370.   28,  28,  27,  25,  25,  24,  23,  22
  371. };
  372.  
  373. struct Preset Preset[] =
  374.   {
  375.     {
  376.       "big_brot",  /* Preset Name */
  377.       -2.000000, -1.204545, /* StartX, StartY */
  378.       2.820000, 1.204545, /* EndX, EndY */
  379.       109, 78, /* CountX,CountY */
  380.       1023,     /* MaxCount */
  381.       0,     /* MandType */
  382.       0x4000,   /* ViewModes */
  383.       5,     /* Depth */
  384.       0,     /* Border Type*/
  385.       &big_brotPalette[0], /* Palette colors */
  386.       32,         /* NumContours */
  387.       &big_brotHeights[0], /* ContourHeights */
  388.       &big_brotPens[0]     /* ContourPens */
  389.     },
  390.     {
  391.       "Hey_Baby",  /* Preset Name */
  392.       -0.143523, -1.019072, /* StartX, StartY */
  393.       -0.143384, -1.018843, /* EndX, EndY */
  394.       96, 65, /* CountX,CountY */
  395.       1023,     /* MaxCount */
  396.       0,     /* MandType */
  397.       0x4000,   /* ViewModes */
  398.       5,     /* Depth */
  399.       0,     /* Border Type*/
  400.       Hey_BabyPalette, /* Palette colors */
  401.       32,         /* NumContours */
  402.       Hey_BabyHeights, /* ContourHeights */
  403.       Hey_BabyPens     /* ContourPens */
  404.     },
  405.     {
  406.       "dragon_family",  /* Preset Name */
  407.       -0.942986, -0.270764, /* StartX, StartY */
  408.       -0.922458, -0.260287, /* EndX, EndY */
  409.       129, 58, /* CountX,CountY */
  410.       1023,     /* MaxCount */
  411.       0,     /* MandType */
  412.       0x4000,   /* ViewModes */
  413.       5,     /* Depth */
  414.       0,     /* Border Type*/
  415.       dragon_familyPalette, /* Palette colors */
  416.       32,         /* NumContours */
  417.       dragon_familyHeights, /* ContourHeights */
  418.       dragon_familyPens     /* ContourPens */
  419.     },
  420.     {
  421.       "spine",  /* Preset Name */
  422.       -1.253688, -0.042351, /* StartX, StartY */
  423.       -1.251284, -0.040954, /* EndX, EndY */
  424.       120, 76, /* CountX,CountY */
  425.       1023,     /* MaxCount */
  426.       0,     /* MandType */
  427.       0x4000,   /* ViewModes */
  428.       4,     /* Depth */
  429.       0,     /* Border Type*/
  430.       spinePalette, /* Palette colors */
  431.       32,         /* NumContours */
  432.       spineHeights, /* ContourHeights */
  433.       spinePens     /* ContourPens */
  434.     },
  435.     {
  436.       "vertibrae",  /* Preset Name */
  437.       -1.253227, -0.041939, /* StartX, StartY */
  438.       -1.251660, -0.041292, /* EndX, EndY */
  439.       105, 56, /* CountX,CountY */
  440.       1023,     /* MaxCount */
  441.       0,     /* MandType */
  442.       0x4000,   /* ViewModes */
  443.       5,     /* Depth */
  444.       0,     /* Border Type*/
  445.       vertibraePalette, /* Palette colors */
  446.       32,         /* NumContours */
  447.       vertibraeHeights, /* ContourHeights */
  448.       vertibraePens     /* ContourPens */
  449.     },
  450.     {
  451.       "beauty",   /* Preset Name */
  452.       -1.252925, -0.041729, /* StartX, StartY */
  453.       -1.252575, -0.041497, /* EndX, EndY */
  454.       98, 56, /* CountX,CountY */
  455.       1023,     /* MaxCount */
  456.       0,     /* MandType */
  457.       0x4000,   /* ViewModes */
  458.       5,     /* Depth */
  459.       0,     /* Border Type*/
  460.       beauty2Palette, /* Palette colors */
  461.       32,         /* NumContours */
  462.       beauty2Heights, /* ContourHeights */
  463.       beauty2Pens     /* ContourPens */
  464.     },
  465.     {
  466.       "sea_horse",  /* Preset Name */
  467.       -0.749790, -0.113353, /* StartX, StartY */
  468.       -0.742342, -0.105343, /* EndX, EndY */
  469.       69, 56, /* CountX,CountY */
  470.       1023,     /* MaxCount */
  471.       0,     /* MandType */
  472.       0x4000,   /* ViewModes */
  473.       5,     /* Depth */
  474.       0,     /* Border Type*/
  475.       sea_horsePalette, /* Palette colors */
  476.       32,         /* NumContours */
  477.       sea_horseHeights, /* ContourHeights */
  478.       sea_horsePens     /* ContourPens */
  479.     },
  480.     {
  481.       "horse_chain",  /* Preset Name */
  482.       -0.745445, -0.113237, /* StartX, StartY */
  483.       -0.744856, -0.112922, /* EndX, EndY */
  484.       105, 56, /* CountX,CountY */
  485.       1023,     /* MaxCount */
  486.       0,     /* MandType */
  487.       0x4000,   /* ViewModes */
  488.       5,     /* Depth */
  489.       0,     /* Border Type*/
  490.       horse_chainPalette, /* Palette colors */
  491.       32,         /* NumContours */
  492.       horse_chainHeights, /* ContourHeights */
  493.       horse_chainPens     /* ContourPens */
  494.     },
  495.     {
  496.       "link",  /* Preset Name */
  497.       -0.745464, -0.113034, /* StartX, StartY */
  498.       -0.745399, -0.112985, /* EndX, EndY */
  499.       95, 56, /* CountX,CountY */
  500.       1023,     /* MaxCount */
  501.       1,     /* MandType */
  502.       0x4000,   /* ViewModes */
  503.       5,     /* Depth */
  504.       0,     /* Border Type*/
  505.       linkPalette, /* Palette colors */
  506.       32,         /* NumContours */
  507.       linkHeights, /* ContourHeights */
  508.       linkPens     /* ContourPens */
  509.     },
  510.     {
  511.       "pretty_baby",  /* Preset Name */
  512.       -0.745436, -0.113016, /* StartX, StartY */
  513.       -0.745399, -0.113003, /* EndX, EndY */
  514.       87, 56, /* CountX,CountY */
  515.       1023,     /* MaxCount */
  516.       1,     /* MandType */
  517.       0x4000,   /* ViewModes */
  518.       5,     /* Depth */
  519.       0,     /* Border Type*/
  520.       pretty_babyPalette, /* Palette colors */
  521.       32,         /* NumContours */
  522.       pretty_babyHeights, /* ContourHeights */
  523.       pretty_babyPens     /* ContourPens */
  524.     },
  525.   };
  526.  
  527. #ifdef DEVELOPMENT
  528. SavePreset(name)
  529.   char *name;
  530. {
  531.   int i;
  532.  
  533.   FILE *SaveFile;
  534.  
  535.   SaveFile = fopen(name,"a");
  536.  
  537.   if (SaveFile != (struct FILE *) NULL) {
  538.  
  539.     fprintf(SaveFile, "SHORT %sPalette[] =\n{\n",name);
  540.     for (i = 0; i < 32; i++) {
  541.       fprintf(SaveFile, "  0x%04x", GetRGB4(vp->ColorMap, i));
  542.  
  543.       if (i != 31)
  544.         fprintf(SaveFile,",");
  545.  
  546.       if (i % 8 == 7)
  547.         fprintf(SaveFile, "\n");
  548.     }
  549.     fprintf(SaveFile, "};\n");
  550.  
  551.     fprintf(SaveFile, "USHORT %sHeights[] =\n{\n",name);
  552.     for (i = 0; i < NumContours; i++) {
  553.       fprintf(SaveFile, "  %d", *(ContourBase + i) );
  554.  
  555.       if (i != NumContours - 1) {
  556.         fprintf(SaveFile,",");
  557.         if (i % 8 == 7)
  558.           fprintf(SaveFile, "\n");
  559.       }
  560.     }
  561.     fprintf(SaveFile, "\n};\n");
  562.  
  563.     fprintf(SaveFile, "UBYTE %sPens[] =\n{\n",name);
  564.     for (i = 0; i < NumContours; i++) {
  565.       fprintf(SaveFile, "  %d", *(ColorBase + i) );
  566.  
  567.       if (i != NumContours - 1) {
  568.         fprintf(SaveFile,",");
  569.         if (i % 8 == 7)
  570.           fprintf(SaveFile, "\n");
  571.       }
  572.     }
  573.     fprintf(SaveFile, "\n};\n");
  574.  
  575.     fprintf(SaveFile, "    {\n");
  576.     fprintf(SaveFile, "      \"%s\",  /* Preset Name */\n", name);
  577.     fprintf(SaveFile, "      %f, %f, /* StartX, StartY */\n",
  578.                                     StartX, StartY);
  579.  
  580.     fprintf(SaveFile, "      %f, %f, /* EndX, EndY */\n", EndX, EndY);
  581.     fprintf(SaveFile, "      %d, %d, /* CountX,CountY */\n",
  582.                              CountX, CountY);
  583.  
  584.     fprintf(SaveFile, "      %d,     /* MaxCount */\n", MaxCount);
  585.  
  586.     fprintf(SaveFile, "      %d,     /* MandType */\n", MandType);
  587.  
  588.     fprintf(SaveFile, "      0x%04x,   /* ViewModes */\n",
  589.                                     screen->ViewPort.Modes);
  590.  
  591.     fprintf(SaveFile, "      %d,     /* Depth */\n",
  592.                                     screen->BitMap.Depth);
  593.  
  594.     fprintf(SaveFile, "      %d,     /* Border Type*/\n", BorderType);
  595.  
  596.     fprintf(SaveFile, "      %sPalette, /* Palette colors */\n",
  597.                                     name);
  598.  
  599.     fprintf(SaveFile, "      %d,         /* NumContours */\n",
  600.                                     NumContours);
  601.  
  602.     fprintf(SaveFile, "      %sHeights, /* ContourHeights */\n", name);
  603.     fprintf(SaveFile, "      %sPens     /* ContourPens */\n", name);
  604.     fprintf(SaveFile, "    },\n\n\n");
  605.   }
  606. }
  607. #endif
  608.